import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import i18n from './lang'
import Iconfont from '@/components/iconfont'
import * as filters from '@/filters'

import '@/common/styles/index.styl'

import ELEMENT from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import echarts from 'echarts/lib/echarts'
import 'echarts/lib/chart/line'
import 'echarts/lib/chart/bar'
import 'echarts/lib/component/title'
import 'echarts/lib/component/legend'
import 'echarts/lib/component/polar'
import 'echarts/lib/component/tooltip'
import 'echarts/lib/component/dataZoom'
import 'echarts/theme/macarons'

Vue.use(Iconfont)
Vue.use(ELEMENT, {
  i18n: (key, value) => i18n.t(key, value)
})

// register filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.prototype.$echarts = echarts

Vue.config.productionTip = false

new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app')
